package com.warm.spring.ioc.expand.event;

import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.ApplicationEventPublisherAware;
import org.springframework.stereotype.Component;

/**
 * @Description TODO
 * @Author iyb-liangchuang
 * @Date 2021/6/3 10:09
 */
@Component
public class InsService implements ApplicationEventPublisherAware {

    private ApplicationEventPublisher publisher;

    @Override
    public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) {
        this.publisher = applicationEventPublisher;
    }

    public void publish(String content){ // 发布事件
        publisher.publishEvent(content);
    }
}
